<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%-- <%@ taglib prefix="s" uri="/struts-tags" %> --%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ page import="com.kh.pajx.sop.util.common.DicUtil"%>
<script src="${pageContext.request.contextPath}/dwz/chart/raphael.js"
	type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/dwz/chart/g.raphael.js"
	type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/dwz/chart/g.bar.js"
	type="text/javascript"></script>
<style>
.myunit {
	width: 4px;
	height: 24px;
	float: left;
}

.lu {
	width: 48px;
	height: 24px;
	float: left;
	text-align: center;
	background-color: #999999;
	
}

.redDiv {
	background-color: #F88A73;
}

.greenDiv {
	background-color: #B5DB67;
}

.grayDiv {
	background-color: #D0D0D0;
}

.td_code {
	width: 100px;
	line-height: 24px;
	text-align: center;
	background-color: #999999;
	font-size: 12px;
	float: left;
	border-bottom: 1px solid white;
}

</style>
<script type="text/javascript">
	function show_equ_online_search(){
		var $sclId = $("#show_equ_online", navTab.getCurrentPanel());
		if(check()){
			$("#show_equ_online", navTab.getCurrentPanel()).click();
		}
	}

	function check(){
		var sid = document.getElementById("show_equOnline_scl_id").value;
		var etype = document.getElementById("equType").value;
		var equNo = document.getElementById("equNo").value;
		var whatDay = document.getElementById("whatDay").value;
		if(sid==""){
			alertMsg.warn("请选择学校！");
			return false;
		}else{
			if(etype==""){
				alertMsg.warn("请选择设备类型！");
				return false;
			}else{
				if((equNo!=0&&equNo!="")&&whatDay==""){
					alertMsg.warn("请选择时间段！");
					return false;
				}
				if(whatDay!=""&&(equNo==0||equNo=="")){
					alertMsg.warn("请选择设备编号！");
					return false;
				}
			}
		}
		return true;
	}
	function getSclId(str){
		navTab.openTab("online", "equOnline_getSchool.action?sclId="+str,{ title:"设备在线监控", fresh:false, data:{} });
	}
	function getShowOnlineEquNo(sclId,scl_name){
		var sclId=document.getElementById("show_equOnline_scl_id").value;
		$("#equType").attr("refUrl","equOnline_findEquNo.action?equType={value}&sclId="+sclId);
		var sclName=document.getElementById("show_equOnline_sclName").value;
		var html = '<option value="">---请选择---</option>';
		html += '<option value="0">考勤设备</option>';
		html += '<option value="1">亲情电话</option>';
		var $ref = $("#equType", navTab.getCurrentPanel());
 		var $refCombox = $ref.parents("div.combox:first");
 		$ref.html(html).insertAfter($refCombox);
 		$refCombox.remove();
 		$ref.combox();
		//navTab.openTab("online","equOnline_getSclEquNo.action?sclId="+sclId+"&sclName="+sclName,{title:"设备在线监控", fresh:false, data:{} });
	}
	
</script>
<div class="pageHeader">
	<form onsubmit="return divSearch(this, 'show_onLine_content');"
		action="equOnline_findEquOnline.action" method="post">
		<div class="searchBar">
		<!--用于回显  -->
		<!-- <s:debug>t</s:debug> -->
		<!-- <input type="text" name="" id="sclid" /> -->
		<div class="searchBar nowrap">
			<%-- <p>
				<label>学校名称：</label> 
			    <select id="sclId" name="sclId" class="combox required" onchange="getSclId(this.value)">
						<option value="">---请选择---</option>
						<c:forEach items="${schoolList }" var="schoolList">
						<option value="${schoolList.sclId }" ${schoolList.sclId eq sclId ? "selected":"" }>${schoolList.sclName }</option>
						</c:forEach>
				</select> 
			</p> --%>
			<p>
								<label>学校名称：</label> 
								<input class="required" 
									id="show_equOnline_scl_id"
									type="hidden" name="model.sclId" value="${sclId }">
								<a title="点击选择学校" href="school_lookup.action?numPerPage=10"
									lookupGroup="model"
									callback="getShowOnlineEquNo('show_equOnline_scl_id','show_equOnline_sclName')">
									<input id="show_equOnline_sclName" 
									type="text" 
									class="required"
									name="model.sclName" 
									readonly="true" 
									value='${sclName }'>
								</a>
							</p>
			
			
			<p>
				<label>设备类型：</label> 
				<select  name="equType" id="equType"  class="combox required" ref="equNo" 
					refUrl="equOnline_findEquNo.action?equType={value}&sclId=">
						<option value="">---请选择---</option>
						<option value="0" ${equType eq "0" ? "selected":"" }>考勤设备</option>
						<option value="1" ${equType eq "1" ? "selected":"" }>亲情电话</option>
				</select>
			</p>
			<p>
				<label>设备编号:</label> 
				<select name="equNo" id="equNo" class="combox">
				<option value="0">---请选择---</option>
				<c:if test="${equNoOne gt 0}">
				 <option value="${equNoOne gt 0 ? equNoOne:'' }" ${equNoOne gt 0 ? "selected":'' }>${equNoOne gt 0 ? equNoOne:"" }</option>
				</c:if>
				</select>
			</p>
			<p>
				<label>时间段:</label> 
			    <select name="whatDay" id="whatDay" class="combox">
						<option value="">---请选择--</option>
						<option value="1" ${whatDay eq "1" ? "selected":"" }>1天内</option>
						<option value="3" ${whatDay eq "3" ? "selected":"" }>3天内</option>
						<option value="7" ${whatDay eq "7" ? "selected":"" }>7天内</option>
				</select>
			</p>
			<div class="subBar">
				<ul>
					<li style="display: none;">
					<div class="buttonActive"><div class="buttonContent">
						<button id="show_equ_online"  type="submit" >检索</button>
					</div></div>
					</li>
					<li><a class="button" href="javascript:show_equ_online_search()" ><span>检索</span></a></li>
				</ul>
			</div>
		</div>

		</div>
	</form>
</div>
<div  id="show_onLine_content">
</div>
